Skip to content

[error_pages] Removing misleading is_granted checker in code example #9029

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

m4r3x
Copy link

@m4r3x m4r3x commented Jan 9, 2018

Docs contain misleading code section that leaves you wondering for a while ;)

This commit clearly states that it's no longer possible:
https://github.com/symfony/symfony/pull/5325/files

@javiereguiluz
Copy link
Member

@m4r3x this was indeed a very annoying thing about Symfony security and error pages ... but we fixed it a while ago (symfony/symfony#15953) and we mentioned it here: https://symfony.com/blog/new-in-symfony-2-8-dx-improvements#allow-to-check-for-security-even-in-pages-not-covered-by-firewalls

That's why I'm closing without merging, but if I overviewed something, please tell me and we'll reopen. Thanks!

@m4r3x
Copy link
Author

m4r3x commented Jan 9, 2018

@javiereguiluz Thank you for your reply. Yes - the exception won't be thrown, you are right.

However, my point is - it's not possible to use is_granted on any error page because token building logic is not yet registered at that point, hence the documentation is displaying code that will NEVER work.

@javiereguiluz
Copy link
Member

@m4r3x I see. Then you are right and I was wrong. Re-opening it!

@xabbuh xabbuh added this to the 2.7 milestone Jan 9, 2018
@javiereguiluz
Copy link
Member

Thank you @m4r3x.

javiereguiluz added a commit that referenced this pull request Jan 9, 2018
… code example (Marek Szymeczko)

This PR was submitted for the master branch but it was merged into the 2.7 branch instead (closes #9029).

Discussion
----------

[error_pages] Removing misleading `is_granted` checker in code example

Docs contain misleading code section that leaves you wondering for a while ;)

This commit clearly states that it's no longer possible:
https://github.com/symfony/symfony/pull/5325/files

Commits
-------

64a996b [error_pages] Removing misleading  checker in code example
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants